import requests

# 创建session对象
session = requests.Session()

url = 'https://www.yaozh.com/login'
head_data = {

    # 字典，需要有一个键值对
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36'
}

data = {
    'type': '0',
    'username': '18670221752',  #
    'pwd': 'a13641481495',
    'pc_vcode': '',
    'country': '86_zh-CN',
    'mobile': '',
    'vcode': '',
    'pincode': '',
    'formhash': '32F50C2812',
    'backurl': 'https%3A%2F%2Fwww.yaozh.com%2F',
}
# session对象登录，记录登录的状态
html = session.post(url, headers=head_data, data=data)
print(html.json())

# session对象的登录的状态去请求
url_main = 'https://www.yaozh.com/'
html = session.get(url_main, headers=head_data)
print(html.text)
